import request from '@/utils/request.js'
import { download } from '@/utils/request.js'
// 污染源列表
///base/pollutionsource/list
export function getEnterpriseList(data ={}) {
  return request({
    url: '/base/pollutionsource/list',
    method: 'get',
    params: data,
  })
}
//行业类型接口
///base/pollutionsource/industryList
export function getIndustryList(data ={}) {
  return request({
    url: '/base/pollutionsource/industryList',
    method: 'get',
    params: data,
  })
}
//污染源新增
///base/pollutionsource/add
export function addPollutionsource(data) {
  return request({
    url: '/base/pollutionsource/add',
    method: 'post',
    data:data
  })
}
//污染源删除
///base/pollutionsource/remove/{ids}
export function removePollutionsource(ids) {
  return request({
    url: `/base/pollutionsource/remove/${ids}`,
    method: 'get',
  })
}

//污染源编辑
///base/pollutionsource/edit
export function editPollutionsource(data) {
  return request({
    url: '/base/pollutionsource/edit',
    method: 'post',
    data:data
  })
}


///base/pollutionsource/edit

// 流域列表
///base/basin/list
export function getBasinList(data ={}) {
  return request({
    url: '/base/basin/list',
    method: 'get',
    params: data,
  })
}

// 河流列表
///base/river/list
export function getRiverList(data ={}) {
  return request({
    url: '/base/river/list',
    method: 'get',
    params: data,
  })
}

// 污染源导出
// /base/pollutionsource/export
function tansParams(params){
  let arr = [];
  for(let key in params){
    arr.push(key + '=' + params[key])
  }
  return arr.join('&')
}
export function pollutionsourceExport(params) {
  return download(`/base/pollutionsource/export`, params, '污染源列表.xlsx')
}